/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Exceptions;

/**
 *
 * @author Assaf
 */
@SuppressWarnings("serial")
public class MoveException extends StrategoException {

    public MoveExceptionType type;

    public MoveException(MoveExceptionType type) {
        super(type.getDescription());
        this.type = type;
    }

    /**
     * @return the type
     */
    public MoveExceptionType getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(MoveExceptionType type) {
        this.type = type;
    }

    public enum MoveExceptionType {
        NotYourSoldier("The square you selected to move from holds another player's soldier"),
        NotValidStartSquare("The square you selected to move from isn't valid"),
        NotValidEndSquare("The square you selected to move to isn't valid"),
        NotValidDistance("You cannot move there"),
        Unknown("Unknown error"), 
        CantAttackOwnSoldier("You can't attack your own soldiers"), 
        BombCantMove("You can't move the bomb"),
        FlagCantMove("You can't move the flag");

        private String desc;
        MoveExceptionType(String desc) {
            this.desc = desc;
        }
        public String getDescription() {
            return desc;
        }
    }
}
